<template>
  <div>
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      :page-sizes="[1, 5, 10, 15]"
      :page-size="pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
    >
    </el-pagination>
  </div>
</template>

<script>
import { mapState, mapMutations, mapActions } from "vuex";
export default {
  data() {
    return {};
  },
  methods: {
    ...mapMutations("list", ["SET_PAGESIZE", "SET_CURRENTPAGE"]),
    ...mapActions("list", ["getList"]),
    handleSizeChange(val) {
      this.SET_PAGESIZE(val);
      this.getList();
    },
    handleCurrentChange(val) {
      this.SET_CURRENTPAGE(val);
      this.getList();
    },
  },
  computed: {
    ...mapState("list", ["pageSize", "currentPage", "total"]),
  },
};
</script>

<style scoped></style>
